package com.ruoyi.lhky.service;

import com.ruoyi.lhky.mapper.TesterMapper;
import com.ruoyi.lhky.pojo.Tester;
import com.ruoyi.lhky.util.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
public class TesterService {

    @Autowired
    private TesterMapper testerMapper;

    public R addTester(Tester tester, Long researchId) {
        testerMapper.insertTester(tester);
        Long testerId = tester.getId();

        testerMapper.insertResearchTester(researchId, testerId);

        return new R(true, "新增受试者成功");
    }
}
